package com.katze.common.ws.config;

import java.time.Duration;

public class WebSocketProperties {

    /**
     * 端口号
     */
    private Integer port = Integer.getInteger("app.port", 9200) - 200;
    /**
     * 请求上下文
     */
    private String path = "/ws";
    /**
     * SSL证书
     */
    private Ssl ssl;
    /**
     * 空闲时长
     */
    private Duration idleTimeout = Duration.ofMinutes(5);

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public Ssl getSsl() {
        return ssl;
    }

    public void setSsl(Ssl ssl) {
        this.ssl = ssl;
    }

    public Duration getIdleTimeout() {
        return idleTimeout;
    }

    public void setIdleTimeout(Duration idleTimeout) {
        this.idleTimeout = idleTimeout;
    }

    public static class Ssl {
        private String keyStorePath;
        private String keyStorePassword;

        public String getKeyStorePath() {
            return keyStorePath;
        }

        public void setKeyStorePath(String keyStorePath) {
            this.keyStorePath = keyStorePath;
        }

        public String getKeyStorePassword() {
            return keyStorePassword;
        }

        public void setKeyStorePassword(String keyStorePassword) {
            this.keyStorePassword = keyStorePassword;
        }
    }
}
